package com.commons.interfaces.interfaces;

import com.commons.interfaces.MyRibbonRuleConfig.MyRibbonConfig;
import com.commons.interfaces.entities.Payment;
import com.commons.interfaces.utils.ResponseData;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @PROJECT_NAME: SpringCloud_AtGuiGu
 * @NAME: OpenfeignClientInterface
 * @Author: lidongming
 * @DATE: 2022/2/10
 * @Desc:
 */

//@FeignClient("PROVIDER-PAYMENT-SERVER")

@FeignClient(value = "provider-payment-server")
//设置负载均衡 引入自定义的负载均衡配置类
@LoadBalancerClient(value = "provider-payment-server",configuration = MyRibbonConfig.class)
public interface OpenfeignClientInterface {


    @GetMapping("/payment/{id}")
    ResponseData<Payment>queryById(@PathVariable  Integer id);
    @PostMapping("/payment")
    ResponseData<Payment>createPayment(@RequestBody Payment payment);
}
